/**
 * Created by huachuan on 2015/12/28.
 */
angular.module('starter.router',[])
  .config(function($stateProvider, $urlRouterProvider) {

    $stateProvider
      // setup an abstract state for the tabs directive
      .state('tab', {
        url: '/tab',
        abstract: true,
        templateUrl: 'templates/tabs.html'
      })

      // Each tab has its own nav history stack:
      //发现（约局）
      .state('tab.discoverIndex', {
        url: '/discoverIndex',
        views: {
          'tab-discover': {
            templateUrl: 'templates/discover/date-card-list.html',
            controller:'DiscoverIndexCtrl'
          }
        }
      })
     // 约局评论
      .state('meetingComment', {
        url: '/meetingComment/:mmId',
        templateUrl: 'templates/discover/meetingComment.html',
        controller:'MeetingCommentCtrl'
      })
      //资讯首页
      .state('tab.newsIndex', {
        url: '/newsIndex',
        views: {
          'tab-news': {
            templateUrl: 'templates/news/index.html',
            controller:'NewsCtrl'
          }
        }
      })
      //书架-视频
      .state('tab.bookshelfIndex', {
        url: '/bookshelfIndex',
        views: {
          'tab-bookshelf': {
            templateUrl: 'templates/bookshelf/video-list.html',
            controller:'BookshelfCtrl'
          }
        }
      })
      //我的首页
      .state('tab.meIndex', {
        url: '/meIndex',
        views: {
          'tab-me': {
            templateUrl: 'templates/me/index.html',
            controller:'MeIndexCtrl'
          }
        }
      })
      //登录
      .state('login', {
        url: '/login',
        templateUrl: 'templates/login/login.html',
        controller:'LoginCtrl'
      })
      //注册
      .state('register', {
        url: '/register',
        templateUrl: 'templates/login/register.html',
        controller:'RegisterCtrl'
      })
      //忘记密码
      .state('lostPwd', {
        url: '/lostPwd',
        templateUrl: 'templates/login/lostPwd.html',
        controller:'lostPwdCtrl'
      })
      //服务详情
      .state('procotol', {
        url: '/procotol',
        templateUrl: 'templates/login/procotol.html',
        controller:'procotolCtrl'
      })

      //发现（约局）-活动详情（未报名）
      .state('date-details', {
        url: '/date-details/:mmId',
        templateUrl: 'templates/discover/date-details.html',
        controller:'MeetingDetailCtrl'
      })
      //LBS定位
      .state('lbs', {
        url: '/lbs',
        templateUrl: 'templates/discover/lbs.html',
        controller:'LbsCtrl'
      })
      //消息盒子
      .state('msg-box', {
        url: '/msg-box',
        templateUrl: 'templates/discover/msg-box.html',
        controller:'MsgBoxCtrl'
      })
      //活动日历
      .state('calendar', {
        url: '/calendar',
        templateUrl: 'templates/discover/calendar.html',
        controller:'CalendarCtrl'
      })
      //当天活动
      .state('day-activity', {
        url: '/day-activity',
        templateUrl: 'templates/discover/day-activity.html',
        controller:'DayActivityCtrl'
      })
      //门店详情
      .state('shop-details', {
        url: '/shop-details/:shopId',
        templateUrl: 'templates/discover/shop-details.html',
        controller:'ShopDetailCtrl'
      })
      //一键导航
      .state('shop-guide', {
        url: '/shop-guide',
        templateUrl: 'templates/discover/shop-guide.html',
        controller:'ShopGuideCtrl'
      })
      //报名列表
      .state('enroll-list', {
        url: '/enroll-list/:mmId',
        templateUrl: 'templates/discover/enroll-list.html',
        controller:'ApplyMemberCtrl'
      })
      //报名人员的信息
      .state('member-data', {
        url: '/member-data/:memberId',
        templateUrl: 'templates/discover/member-data.html',
        controller:'MemberDataCtrl'
      })
      //我要报名
      .state('enroll-from', {
        url: '/enroll-from/:mmId',
        templateUrl: 'templates/discover/enroll-from.html',
        controller:'SignInCtrl'
      })
      //报名成功
      .state('enroll-from-success', {
        url: '/enroll-from-success',
        templateUrl: 'templates/discover/enroll-from-success.html',
        controller:'SignInSuccessCtrl'
      })
      //发布酒窝
      .state('release-home', {
        url: '/release-home',
        templateUrl: 'templates/discover/dimple-my-release.html',
        controller:'ReleaseHomeCtrl'
      })
      //用户的酒窝
      .state('user-dimple-care-list', {
        url: '/user-dimple-care-list/:memberId',
        templateUrl: 'templates/discover/user-dimple-care-list.html',
        controller:'OtherUserHomeCtrl'
      })
      .state('homeComment',{
        url: '/homeComment/:mhId',
        templateUrl: 'templates/discover/homeComment.html',
        controller:'HomeCommentCtrl'
      })
      //发布约局
      .state('release-date', {
        url: '/release-date',
        templateUrl: 'templates/discover/release-date.html',
        controller:'ReleaseMeetingCtrl'
      })
      //发布约局--填写描述内容
      .state('release-depict', {
        url: '/release-depict',
        templateUrl: 'templates/discover/release-depict.html',
        controller:'ReleaseDescCtrl'
      })
      //发布约局--约局地点选择
      .state('select-site-list', {
        url: '/select-site-list',
        templateUrl: 'templates/discover/select-site-list.html',
        controller:'ReleaseMeetingAddrCtrl'
      })
      //发布约局--选择酒款---->我的收藏
      .state('my-collect', {
        url: '/my-collect',
        templateUrl: 'templates/discover/my-collect.html',
        controller:'MeCollectWineCtrl'
      })
      //发布约局--选择酒款---->搜索酒库
      .state('barcode-search-list', {
        url: '/barcode-search-list',
        templateUrl: 'templates/discover/barcode-search-list.html',
        controller:'BarCodeSearchWineCtrl'
      })
      //发布约局--选择酒款---->搜索酒库
      .state('search-list', {
        url: '/search-list',
        templateUrl: 'templates/discover/search-list.html',
        controller:'SearchWineCtrl'
      })
      //发布约局--选择酒款---->手动输入
      .state('handin_wine', {
        url: '/handin_wine',
        templateUrl: 'templates/discover/handin_wine.html',
        controller:'HandInWineCtrl'
      })
      //发布约局(私密约)---->受邀对象
      .state('invite-user-list', {
        url: '/invite-user-list',
        templateUrl: 'templates/discover/invite-user-list.html',
        controller:'InviteUserListCtrl'
      })
      //我的活动---我发起,邀请我,已报名
      .state('my-activity', {
        url: '/my-activity',
        templateUrl: 'templates/discover/my-activity.html',
        controller:'MyActiviityCtrl'
      })
      //酒库
      .state('productIndex',{
        url: '/productIndex',
        templateUrl: 'templates/product/index.html',
        controller:'WineIndexCtrl'
      })
      //扫描条形码或者输入条形码获取酒款
      .state('wineSearch',{
        url: '/wineSearch',
        templateUrl: 'templates/product/search-list.html',
        controller:'WineSearchCtrl'
      })
      //酒库搜索
      .state('barcodeSearch',{
        url: '/barcodeSearch',
        templateUrl: 'templates/product/barcodeSearch.html',
        controller:'BarCodeSearchCtrl'
      })
      //酒款详情
      .state('winedetails', {
        url: '/winedetails/:wineId',
        templateUrl: 'templates/product/details.html',
        controller:'WineDetailCtrl'
      })
    // 酒款详情评论
      .state('wineComment', {
        url: '/wineComment/:wineId',
        templateUrl: 'templates/product/wineComment.html',
        controller:'WineCommentCtrl'
      })
      //咨询详情
      .state('newsDetails', {
        url: '/newsDetails/:messageId',
        templateUrl: 'templates/news/details.html',
        controller:'NewsDetailCtrl'
      })
      //新闻评论列表
      .state('newsomment', {
        url: '/newsomment/:messageId',
        templateUrl: 'templates/news/comment.html',
        controller:'NewsCommentCtrl'
      })
      //视频详情
      .state('video-details', {
        url: '/video-details/:videoId',
        templateUrl: 'templates/bookshelf/video-details.html',
        controller:'VideoDetailCtrl'
      })
      //视频评论
      .state('videoComment',{
        url: '/videoComment/:videoId',
        templateUrl: 'templates/bookshelf/comment.html',
        controller:'VideoCommentCtrl'
      })
      //书本章节目录
      .state('book-catalog', {
        url: '/book-catalog/:magazineId',
        templateUrl: 'templates/bookshelf/book-catalog.html',
        controller:'CatalogCtrl'
      })
      //章节内容
      .state('book-details', {
        url: '/book-details/:bdId',
        templateUrl: 'templates/bookshelf/book-details.html',
        controller:'CatalogDetailCtrl'
      })
      //章节内容评论
      .state('magazine-comment', {
        url: '/magazine-comment/:bdId',
        templateUrl: 'templates/bookshelf/magazine-comment.html',
        controller:'MagazineCommentCtrl'
      })

      //个人资料（未认证）
      .state('my-data', {
        url: '/my-data',
        cache:'false',
        templateUrl: 'templates/me/my-data.html',
        controller:'MeMyDataCtrl'
      })
      //个人资料（认证审核通过）/个人资料（认证正在审核中）/个人资料（认证失败）
      .state('my-certified-status', {
        url: '/my-certified-status',
        templateUrl: 'templates/me/my-certified-status.html'
      })
      //修改密码
      .state('revise-password', {
        url: '/revise-password',
        templateUrl: 'templates/me/revise-password.html',
        controller:'MeRevisePasswordCtrl'
      })
      //我的身份等级
      .state('my-level', {
        url: '/my-level',
        templateUrl: 'templates/me/my-level.html',
        controller: 'MeMyLevelCtrl'
      })
      //我的关注
      .state('my-care-list', {
        url: '/my-care-list',
        templateUrl: 'templates/me/my-care-list.html',
        controller:'MeAttendCtrl'
      })
      //查找好友
      .state('search-friend-list', {
        url: '/search-friend-list',
        templateUrl: 'templates/me/search-friend-list.html',
        controller:'SearchFriendCtrl'
      })
      //我的收藏--酒款
      .state('collect-wine', {
        url: '/collect-wine',
        templateUrl: 'templates/me/collect-wine.html',
        controller:'MeCollectCtrl'
      })
      //账号绑定
      .state('binding', {
        url: '/binding',
        templateUrl: 'templates/me/binding.html',
        controller : 'BindingCtrl'
      })
      .state('bindMember', {
        url: '/bindMember',
        templateUrl: 'templates/me/bindMember.html',
        controller : 'BindMemberCtrl'
      })
      //积分商城
      .state('integrat-list', {
        url: '/integrat-list',
        templateUrl: 'templates/me/integrat-list.html',
        controller : 'IntegratListCtrl'
      })
      //积分商城--查看大图
      .state('integrat-big-pic', {
        url: '/integrat-big-pic',
        templateUrl: 'templates/me/integrat-big-pic.html'
      })
      //积分商城--填写兑换信息
      .state('converted-msg', {
        url: '/converted-msg',
        templateUrl: 'templates/me/converted-msg.html',
        controller : 'ConvertedMsgCtrl'
      })
      //查看商品兑换结果
      .state('point-product-msg', {
        url: '/point-product-msg/:mnId',
        templateUrl: 'templates/me/point-product-msg.html',
        controller : 'MePointProductMsgCtrl'
      })
      //我的积分
      .state('my-integrat', {
        url: '/my-integrat',
        templateUrl: 'templates/me/my-integrat.html',
        //创建一个控制器
        controller:'IntegratCtrl'
      })
      //我的积分-积分明细
      .state('my-integrat-detail', {
        url: '/my-integrat-detail',
        templateUrl: 'templates/me/my-integrat-detail.html',
        controller : 'MyIntegratDetailCtrl'
      })
      //推荐酒单
      .state('recommend-list', {
        url: '/recommend-list',
        templateUrl: 'templates/me/recommend-list.html',
        controller: 'MeRecommendListCtrl'
      })
      //生成推荐酒单
      .state('recommend-order-list', {
        url: '/recommend-order-list',
        templateUrl: 'templates/me/recommend-order-list.html',
        controller: 'MeRecommendOrderListCtrl'
      })
      //历史推荐酒单
      .state('history-list', {
        url: '/history-list',
        templateUrl: 'templates/me/history-list.html',
        controller : 'MeHistoryListCtrl'
      })
      //历史酒单详情
      .state('history-order-detail', {
        url: '/history-order-detail',
        templateUrl: 'templates/me/history-order-detail.html',
        controller : 'MeHistoryOrderDetailCtrl'
      })
      //删除历史酒单中的酒款
      .state('history-order-del',{
        url: '/history-order-del',
        templateUrl: 'templates/me/history-order-del.html',
        controller : 'MeHistoryOrderDelCtrl'
      })
      //我的酒窝
      .state('my-dimple-list', {
        url: '/my-dimple-list',
        templateUrl: 'templates/me/my-dimple-list.html',
        controller:'MeHomeCtrl'
      })
      //更多
      .state('more-list', {
        url: '/more-list',
        templateUrl: 'templates/me/more-list.html',
        controller:'meMoreListCtrl'
      })
      //更多--关于我们
      .state('more-about-us', {
        url: '/more-about-us',
        templateUrl: 'templates/me/more-about-us.html',
        controller : 'meMoreAboutUsCtrl'
      })
      //更多--关于合作
      .state('more-cooperate', {
        url: '/more-cooperate',
        templateUrl: 'templates/me/more-cooperate.html',
        controller : 'meMoreCooperateCtrl'
      })
      //更多--积分规则说明
      .state('more-rule', {
        url: '/more-rule',
        templateUrl: 'templates/me/more-rule.html',
        controller : 'meMoreRuleCtrl'
      })
      //更多--意见反馈
      .state('more-opinionaire', {
        url: '/more-opinionaire',
        templateUrl: 'templates/me/more-opinionaire.html',
        controller : 'meMoreOpinionaireCtrl'
      })
      .state('guide',{
        url:'/guide',
        templateUrl: 'templates/guide.html',
        controller:'GuideCtrl'
      })
      .state('ad',{
        url:'/ad',
        templateUrl: 'templates/ad.html',
        controller:'AdCtrl'
      })
      //资讯更多
        .state('newsMore', {
          url: '/newsMore/:newType',
          templateUrl: 'templates/news/list.html',
          controller:'NewsMoreCtrl'
        })
        //书架-视频-更多
        .state('videoMore', {
          url: '/videoMore',
          templateUrl: 'templates/bookshelf/video-more.html',
          controller:'VideoMoreCtrl'
        })
        //书架-搜索
        .state('bookshelfSearch', {
          url: '/bookshelfSearch/:type',
          templateUrl: 'templates/bookshelf/search.html',
          controller:'BookshelfSearchCtrl'
        })
        //资讯-搜索
        .state('newsSearch', {
          url: '/newsSearch/:type',
          templateUrl: 'templates/news/search.html',
          controller:'NewsSearchCtrl'
        })
    ;

    $urlRouterProvider.otherwise('/login');


  });
